<?php
//测试控制器类
class IndexController extends Controller{
    //动作方法
	public function index(){
        //显示视图
		$this->display();
	}
	//数据备份
	public function backup(){
		$result = Backup::backup(
			array(
				'size'=>200,
				'dir'=>'backup/'.date('Ymdhis'),
				'step_time'=>1
				)
			);
		if ($result === false) {
			$this->error(Backup::$error, 'index');
		}else{
			if ($result['status'] == 'success') {
				$this->success('备份完成', 'index');
			}else{
				$this->success($result['message'], $result['url'], 0.1);
			}
		}
	}
}
